<?php
	include_once(dirname(__DIR__) . "/include/dbconnection.php");

	class MySQLExecutor {
		private $create_file = "forum_create.sql";
		private $insert_file = "forum_insert.sql";
		
		public function mysqlExecuteFile($sql_file) {
			$file = file_get_contents(dirname(__DIR__) ."/sql/". $sql_file);
			$file = explode(';', $file);
			
			foreach($file as $line) {
				mysql_query($line);
			}
		}
		
		public function createForumDatabase() {
			$this -> mysqlExecuteFile($this -> create_file);
		}
		
		public function insertForumDatabase() {
			$this -> mysqlExecuteFile($this -> insert_file);
		}
	}
?>